package cn.heyige.backend.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "用户注册请求（增强版）")
public class UserRegistrationRequestV2 {
    
//    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @Schema(description = "手机号", example = "13800138000")
    private String phone;
    
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*\\d)[a-zA-Z\\d]{8,20}$", 
             message = "密码必须8-20位，包含数字和字母")
    @Schema(description = "密码", example = "123456Aa")
    private String password;
    
//    @NotBlank(message = "验证码不能为空")
    @Pattern(regexp = "^\\d{6}$", message = "验证码必须为6位数字")
    @Schema(description = "短信验证码", example = "123456")
    private String verificationCode;
    
    @Size(max = 20, message = "昵称不能超过20个字符")
    @Schema(description = "昵称", example = "易学爱好者")
    private String nickname;

    @Size(max = 20, message = "邀请码不能超过20个字符")
    @Schema(description = "邀请码", example = "INV123456")
    private String inviteCode;
}